﻿using System;
using System.Data;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.general.system.workflow.flow_type
{
    public partial class type_view_list : ModulePage
    {        

        public string FomatPrcsTo(string prcsTo)
        {
            if (prcsTo == string.Empty)
            {
                return string.Empty;
            }
            prcsTo = "," + prcsTo + ",";
            prcsTo = prcsTo.Replace(",0,", ",结束,");
            if (prcsTo.StartsWith(","))
            {
                prcsTo = prcsTo.Substring(1);
            }
            if (prcsTo.EndsWith(","))
            {
                prcsTo = prcsTo.Substring(0, prcsTo.Length - 1);
            }
            return prcsTo;
        }
       

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int num = (Request.QueryString["flow_id"] == null) ? 0 : int.Parse(Request.QueryString["flow_id"].ToString());
                this.ViewState["FlowId"] = num;
                DataTable table = new FlowTypeDao().SelectByFlowId(base.Conn, num);
                if (table.Rows.Count > 0)
                {
                    this.litFlowName.Text = table.Rows[0]["FlowName"].ToString();
                    this.litFlowName2.Text = table.Rows[0]["FlowName"].ToString();
                }
                DataTable table2 = new FlowProcessDao().SelectByFlowId(base.Conn, num);
                if (table2.Rows.Count > 0)
                {
                    this.rptFlowProcess.DataSource = table2;
                    this.rptFlowProcess.DataBind();
                }
                else
                {
                    this.litMessage.Text = base.ShowMessage("尚未定义流程步骤");
                    this.rptFlowProcess.Visible = false;
                }
            }
        }
       
    }
}

